#include <QApplication>

#include "peer_node_server_ui.h"
#include "logger.h"

INITIALIZE_EASYLOGGINGPP;

int main(int argc, char *argv[])
{
    {
        // 只需要在 main() 开始时候初始化一次就够, 当然后续根据子集需要  defaultConf.set()  el::Loggers::reconfigureLogger,
        // defaultConf.setGlobally()   el::Loggers::reconfigureLogger(),
        el::Configurations defaultConf;
        defaultConf.set(el::Level::Info, el::ConfigurationType::Format, "%datetime %level %msg");
        defaultConf.setGlobally(el::ConfigurationType::Filename, "../log/peer_node_log_%datetime{%Y%M%d_%H%m%s}.log");
        // "./log/log_%datetime{%Y%M%d_%H%m%s}.log"
        el::Loggers::reconfigureLogger("default", defaultConf);
    }

    MYLOG("peernode start ...");

    QApplication a(argc, argv);
    PeerNodeServerUi w;
    w.show();
    return a.exec();
}
